/*
 * @Description: 文章获取
 * @Author: zheng yiliang
 * @Date: 2021-05-09 10:58:10
 * @LastEditTime: 2021-06-13 17:27:14
 * @LastEditors: zheng yiliang
 */
import { articlesgory } from '@/api'
export default {
  namespaced: true,
  state: {
    // 分类标签页显示隐藏
    articles: []
  },
  mutations: {
    articleQry (state, val) {
      val.sort((x, y) => y.top - x.top)
      state.articles = val
    }
  },
  actions: {
    async articleQry ({ commit }, condition) {
      const { _RejCode, data } = await articlesgory(condition)
      if (_RejCode !== '00000000') return
      commit('articleQry', data.list)
    }
  }
}
